package com.example.design.websocket;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

//@Component
@Slf4j
@EnableScheduling
public class WebSocketTask {
    /**
     * 每5秒进行一次websocket心跳检测
     */
    @Scheduled(cron = "0/5 * * * * ?")
    public void clearOrders() {
        WebSocketSever.sendAllMessage("send heart..");
    }
}
